package com.hospital.dictionary.module.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hospital.common.core.result.SuccessTip;
import com.hospital.common.core.result.Tip;
import com.hospital.dictionary.module.controller.base.BaseController;
import com.hospital.dictionary.module.entity.AddressDict;
import com.hospital.dictionary.module.service.AddressDictService;
import com.hospital.dictionary.query.QueryGenerator;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lvyao
 * @since 2022-02-14
 */
@RestController
@RequestMapping("/module/addressDict")
public class AddressDictController extends BaseController<AddressDict,AddressDictService> {

    @Override
    public Tip queryList(AddressDict addressDict, Integer pageNo, Integer pageSize, HttpServletRequest req) {
        QueryWrapper<AddressDict> queryWrapper= QueryGenerator.initQueryWrapper(addressDict,req.getParameterMap());
        IPage<AddressDict> page=new Page<>(pageNo,pageSize);
        IPage<AddressDict> pageList=baseService.page(page,queryWrapper);
        return new SuccessTip(pageList);
    }
}

